import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello world!");
    }
}
class Solution {
    public int missingNumber(int[] nums) {
        Arrays.sort(nums);
        int left = 0,right = nums.length-1;
        while (left<right) {
            int mid = left + (right - left) / 2;
            if (mid == nums[mid]) left = mid + 1;
            else right = mid;
        }
        if (nums[left] == left) return left+1;
        return left;
        System.out.println();
    }
}